<template>
  <div>
    <banner></banner>
    <div class="questionsContent">
      <header>当前第4题/共8题</header>
      <p>4.你选择我们学校的原因主要是？（多选）</p>
      <checkbox-group class="radioGroup"
        @change="getRadioValue"
      >
        <label
          @click="reasonMsg(index)"
          class="radio"
          v-for="(item,index) in subData"
          :index="index"
          :key="index"
        >
          <checkbox :value="item.value" />
          <span>{{item.value}}</span>
        </label>
      </checkbox-group>
      <button @click="PlusIndex" type="primary">下一题</button>
    </div>
  </div>
</template>

<script>
import banner from "@/components/questionBanner.vue";
import Vue from "vue"
export default {
  data() {
    return {
      subData: [
        { value: "A.课程体系优" },
        { value: "B.口碑好" },
        { value: "C.就业前景好" },
        { value: "D.教学质量佳" },
        { value: "E.校区规模大" },
        { value: "F.性价比高" },
        { value: "G.校园环境好" },
        { value: "H.试听效果好" },
        { value: "I.品牌知名度" },
        { value: "J.师资力量" },
        { value: "K.课程模式" },
        { value: "L.父母决定" },
        { value: "M.亲友的决定" },
        { value: "N.专业兴趣" },
        { value: "Q.其他" }
      ],
      currentIndex: ""
    };
  },
  components: {
    banner
  },
  methods: {
    PlusIndex() {
      if (this.currentIndex == "") {
        wx.showToast({
          title: "不能为空",
          duration: 2000,
          icon: "none"
        });
      } else {
        wx.navigateTo({ url: "../questionFive/main" });
      }
    },
    reasonMsg(index) {
      this.currentIndex = index + 1;
    },
           getRadioValue(e) {
      Vue.prototype.cause = e.mp.detail.value;
    }
  },
  created() {},
  onLoad() {}
};
</script>

<style scoped>
</style>
